Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 4 - Colors and Color-Related Objects / Colors and Color-Related Objects Reference
Color Set Functions / Retrieving and Replacing Colors in a Color Set


GXSetColorSetParts

You can use the GXSetColorSetParts function to replace specified colors in a color set object.

void GXSetColorSetParts(gxColorSet target, long index, 
                         long oldCount, long newCount, 
                         const gxSetColor data[]);
target
A reference to the color set object whose color values you want to modify.
index
The first color value to replace. To replace the first color value in the color set, specify 1 for this parameter.
oldCount
The number of color values to replace. Specify gxSelectToEnd to replace all color values in the color set including and beyond index.
newCount
The number of new color values to add; that is, the number of color values in the data array.
data
The array of color values to add to the color set.
DESCRIPTION
The GXSetColorSetParts function assigns the specified color values to the target color set, starting at the location specified by index after first removing the number of existing color values specified by oldCount.

This function does not accept the gxSetToNil constant for the data parameter. If you want to simply remove colors, pass 0 for newCount.

The current implementation of QuickDraw GX restricts the number of colors in a color set to a maximum of 65,535.

SPECIAL CONSIDERATIONS
If you attempt to modify the color values of a color set object used by an onscreen view device, this function posts a colorSet_access_restricted warning.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
colorSet_is_nil
inconsistent_parameters(debugging version)
index_is_less_than_zero(debugging version)
count_is_less_than_zero(debugging version)
number_of_colors_exceeds_implementation_limit
Warnings 
index_out_of_range 
count_out_of_range 
colorSet_access_restricted(debugging version)
SEE ALSO
To retrieve the entire array of color values from a color set object, use the GXGetColorSet function, described on page 4-73. To replace the entire array of color values in a color set object, use the GXSetColorSet function, described on page 4-74. To retrieve some of the color values in a color set object, use the GXGetColorSetParts function, described in the previous section.

The gxSetColor union is described on page 4-56.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996